<template>
  <nav class="navigation">
    <div class="nav-container">
      <h1 class="logo">新车价格查询系统</h1>
      <ul class="nav-links">
        <li>
          <router-link to="/query" :class="{ active: $route.name === 'Query' }">价格查询</router-link>
        </li>
        <li>
          <router-link to="/manage" :class="{ active: $route.name === 'Manage' }">信息管理</router-link>
        </li>
      </ul>
    </div>
  </nav>
</template>

<script>
export default {
  name: 'NavigationBar'
};
</script>

<style scoped>
.navigation {
  background-color: #2c3e50;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative; /* 确保导航条在页面顶部 */
  z-index: 1000; /* 确保导航条在其他元素之上 */
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  color: white;
  margin: 0;
  font-size: 24px;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 20px;
}

.nav-links a {
  display: block;
  color: #ecf0f1;
  text-decoration: none;
  padding: 20px 15px;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #42b983;
}

.nav-links a.active {
  color: #42b983;
  font-weight: bold;
}
</style>